#region Using References

using System;
using System.Drawing;
using System.IO;
using System.Runtime.Serialization;
using Beaker.OpenCube.Metadata.TypeConverters;
using Beaker.Services.FileSystem;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

#endregion

namespace Beaker.OpenCube.Metadata
{
	[DataContract]
	[JsonConverter( typeof( StringEnumConverter ) )]
	public enum LauncherVisibility
	{
		[EnumMember( Value = "Close launcher when game starts" )]
		Close,
		[EnumMember( Value = "Hide launcher and re-open when game closes" )]
		HideAndReopen,
		[EnumMember( Value = "Keep the launcher open" )]
		KeepOpen
	}

	[DataContract]
	public class ProfileConfigurationMetadata
		: INamedMetadata
	{
		[DataMember( Name = "name" )]
		public string Name { get; set; }

		[DataMember( Name = "lastVersionId" )]
		public string LastVersionId { get; set; }

		[DataMember( Name = "gameDir" )]
		[JsonConverter( typeof( PathConverter ) )]
		public IFolder GameFolder { get; set; }

		[DataMember( Name = "javaDir" )]
		[JsonConverter( typeof( PathConverter ) )]
		public IFile JavaFile { get; set; }

		[DataMember( Name = "javaArgs" )]
		public string JavaArgs { get; set; }

		[DataMember( Name = "resolution" )]
		[JsonConverter( typeof( JsonSizeConverter ) )]
		public Size Resolution { get; set; }

		[DataMember( Name = "allowedReleaseTypes" )]
		public string[] AllowedReleaseTypes { get; set; }

		[DataMember( Name = "playerUUID" )]
		[JsonConverter( typeof( UuidConverter ) )]
		public Guid PlayerUuid { get; set; }

		[DataMember( Name = "launcherVisibilityOnGameClose" )]
		public LauncherVisibility LauncherVisibility { get; set; }
	}
}